<%@page import="java.sql.ResultSet"%>
<%@page import="com.upc.virtes.ConexionPgSQL"%>

<%
int contaCheckbox = 0;
ConexionPgSQL Conexion = new ConexionPgSQL();
Conexion.ConexionPgsql();

String Sql = "SELECT cod_usuario,nombres, apellidos, organizacion, email, usuario, clave, host FROM usuarios WHERE cod_usuario='"+request.getParameter("cod_usuario")+"'";
Conexion.QuerySQL(Sql);
ResultSet Filas = Conexion.getRs();

while(Filas.next())
{
%>
<div id="divGeneral" style="left: 380px; top: 210px" class="box_flotante">
	<form id="formGeneral">
	       	<table border="0" cellpadding="0" cellspacing="0" class="tabla_prueba1">
			<tr>
				<td class="titulo_box_flotante" onmousedown="ajax.agarrarDiv(event,'divGeneral');" onmouseup="ajax.soltarDiv();">
      					Modificaci&oacute;n de usuario de sistema
				</td>
				<td class="cerrar_box_flotante">
					<img src="images/cross.gif" onclick="ajax.removerObjeto('divGeneral','boxzone');">
				</td>
			</tr>
			<tr>
				<td colspan='2' class='txt_simple'>
					Codigo
					<br />
                                        <input name='inputForm' size='8' class='disable_box' maxLength='8' value='<%=Filas.getString(1) %>' disabled>
				</td>
			</tr>
			<tr>
				<td colspan='2' class='txt_simple'>
					Nombres
					<br />
					<input name='inputForm' size='30' class='text_box' maxLength='30' value='<%=Filas.getString(2) %>'>
				</td>
			</tr>                        
			<tr>
				<td colspan='2' class='txt_simple'>
					Apellidos
					<br />
					<input name='inputForm' size='30' class='text_box' maxLength='50' value='<%=Filas.getString(3) %>'>
				</td>
			</tr>                        
                        <tr>
                                <td colspan='2' class='txt_simple'>
                                        Organizaci&oacute;n
                                        <br />
                                        <input name='inputForm' size='30' class='text_box' maxLength='50' value='<%=Filas.getString(4) %>'>
                                </td>
                        </tr>
                        <tr>
                                <td colspan='2' class='txt_simple'>
                                        E-mail
                                        <br />
                                        <input name='inputForm' size='30' class='text_box' maxLength='50' value='<%=Filas.getString(5) %>'>
                                </td>
                        </tr>
			<tr>
				<td colspan='2' class='txt_simple'>
					Usuario
					<br />
					<input name='inputForm' size='4' class='text_box' maxLength='4' value='<%=Filas.getString(6) %>'>
				</td>
			</tr>
			<tr>
				<td colspan='2' class='txt_simple'>
					Clave
					<br />
					<input name='inputForm' size='15' class='text_box' maxLength='15' value='<%=Filas.getString(7) %>'>
				</td>
			</tr>
                        <tr>
                                <td colspan='2' class='txt_simple'>
                                        Host de acceso
                                        <br />
                                        <input name='inputForm' size='15' class='text_box' maxLength='15' value='<%=Filas.getString(8) %>'>
                                </td>
                        </tr>
			<tr>
				<td colspan='2' class='txt_simple'>
					Permisos de la cuenta
					<br />
				</td>
			</tr>

<%
}

Sql = "SELECT cod_bloque,nombre FROM bloques ORDER BY cod_bloque ASC";
Conexion.QuerySQL(Sql);
Filas = Conexion.getRs();

while(Filas.next())
{
    contaCheckbox++;
%>
<tr>
    <td colspan='1' class='txt_simple'>
        <input type='checkbox' name='inputForm' class='boton_enviar' value='<%=Filas.getString(1) %>'>
        <%=Filas.getString(2) %>
    </td>
</tr>
<%
}
%>

			<tr>
				<td align='center'>
					<br /><input type="button" value="Guardar" class="boton_enviar" onclick="ajax.insertarDatos('formGeneral','<%=contaCheckbox+8 %>','grabar.jsp','seccion=Ausua&nroCheckbox=<%=contaCheckbox %>','js','boxzone');">
					      <input type="button" value="Cancelar" class="boton_enviar" onclick="ajax.removerObjeto('divGeneral','boxzone');">
				</td>
			</tr>
		</table>
	</form>
</div>
